package com.hy.util;

import java.util.ArrayList;

class Classes {
    private int startHour;
    private int startMinute;
    private int endHour;
    private int endMinute;

    public Classes(int startHour, int startMinute, int endHour, int endMinute) {
        this.startHour = startHour;
        this.startMinute = startMinute;
        this.endHour = endHour;
        this.endMinute = endMinute;
    }

    public int getStartHour() {
        return startHour;
    }

    public int getStartMinute() {
        return startMinute;
    }

    public int getEndHour() {
        return endHour;
    }

    public int getEndMinute() {
        return endMinute;
    }
}

public class Main {
    public static void main(String[] args) {
        Classes newShift = new Classes(12, 1, 13, 0);
        java.util.List<Classes> existingShifts = new ArrayList<>();
        existingShifts.add(new Classes(9, 0, 12, 0));
        existingShifts.add(new Classes(14, 0, 18, 0));
        boolean isConflict = isTimeConflict(newShift, existingShifts);
        System.out.println(isConflict ? "存在时间上的冲突" : "不存在时间上的冲突");
    }

    public static boolean isTimeConflict(Classes newClasses, java.util.List<Classes> list) {
        int newStart = newClasses.getStartHour() * 60 + newClasses.getStartMinute();
        int newEnd = newClasses.getEndHour() * 60 + newClasses.getEndMinute();
        for (Classes shift : list) {
            int start = shift.getStartHour() * 60 + shift.getStartMinute();
            int end = shift.getEndHour() * 60 + shift.getEndMinute();
            if (newStart < end && newEnd > start) {
                return true;
            }
        }
        return false;
    }
}